package com.qiangzhi.controller.student;

import com.qiangzhi.result.Result;
import com.qiangzhi.service.StudentInfoService;
import com.qiangzhi.pojo.vo.StudentVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 学生个人中心相关接口
 */
@RestController
@RequestMapping("/student/info")
@Api(tags = "学生个人中心相关接口")
@Slf4j
public class StudentInfoController {

    @Autowired
    private StudentInfoService studentInfoService;

    /**
     * 根据jwt解析出的id查询学生信息
     *
     * @return
     */
    @GetMapping
    @ApiOperation("根据id查询学生信息")
    public Result<StudentVO> getById() {
        log.info("查询学生信息");
        StudentVO studentVO = studentInfoService.getById();
        return Result.success(studentVO);
    }

}
